<template>
	<!-- 款式信息 -->
	<div class="mainContent styleInfoContainer">
		<div class="bread-nav">
			<span class="bread-item">商品管理</span>
			<span class="bread-icon">&gt;</span>
			<span class="bread-item">商品款式</span>
			<span class="bread-icon">&gt;</span>
			<span class="bread-item">款式信息</span>
		</div>
		<!--  -->
		<div class="styleInfoContant">
			<div class="search-box">
				<!--  -->
				<advancedSearch :option="Model.filterOption" @getChild="showChild" @onSearch="toSearch" @onClear="toClear"
				 @onExport="toExport"></advancedSearch>
			</div>
			<!-- table  -->
			<div class="styleInfoTable">
				<el-row>
					<div class="common-table-title">
						<div class="common-table-icon"></div>
						<div class="common-table-fl">款式信息</div>
					</div>
				</el-row>
				<!--  -->
				<el-row class="common-table-con">
					<el-table :data="Model.tableData" max-height="500">
						<el-table-column align="center" label="款式号" width="">
							<template slot-scope="scope">
								<el-button type="text" @click="showMore(scope.row)"><a class="detial-link">{{scope.row.modelNo}}</a></el-button>
							</template>
						</el-table-column>
						<el-table-column align="center" v-for="(item,index) in Model.tableHeaderData" :key="item.prop" v-if="item.prop == 'material' || item.prop == 'handRange' || item.prop == 'insert' "
						 :label="item.label" :width="item.width">
							<template slot-scope="scope">
								<el-button type="text" @click="showMore(scope.row,item.prop)"><a class="detial-link">更多</a></el-button>
							</template>
						</el-table-column>
						<el-table-column align="center" v-else-if="item.prop== 'imgUrl' " :key="item.prop" :prop="item.prop" :label="item.label"
						 :width="item.width">
							<template slot-scope="scope">
								<el-tooltip placement="top" effect="light">
									<div slot="content"><img class="maxTableImg" :src="scope.row.imgUrl" alt=""></div>
									<img class="mainTableImg" :src="scope.row.imgUrl" alt="">
								</el-tooltip>
							</template>
						</el-table-column>
						<el-table-column align="center" v-else :key="item.prop" :prop="item.prop" :label="item.label" :width="item.width">
						</el-table-column>
						<el-table-column align="center" fixed="right" label="操作" width="120">
							<template slot-scope="scope">
								<el-button type="text" @click="showMore(scope.row)"><a class="detial-link">上传图片</a></el-button>
							</template>
						</el-table-column>
					</el-table>
					<!-- 分页 -->
					<!-- 产品需求大类不需要分页，中类和小类则需要 -->
					<el-row class="pagination-cont">
						<el-pagination @size-change="handleSizeChange" background @current-change="handleCurrentChange" :current-page="Model.paginationObject.currentPage"
						 :page-sizes="[10, 20, 30, 40]" :pager-count="5" :page-size="Model.paginationObject.pageSize" layout="sizes, prev, pager, next, jumper, slot"
						 :total="Model.paginationObject.total">
							<div class="pagination-slot">
								显示
								<p class="slot-i">{{Model.paginationObject.num1}}</p>
								到
								<p class="slot-i">{{Model.paginationObject.num2}}</p>
								，共
								<p class="slot-i">{{Model.paginationObject.total}}</p>
								记录
							</div>
						</el-pagination>
					</el-row>
				</el-row>
			</div>
			<!-- table end -->
			<!-- 弹窗1 -->
			<el-dialog :visible.sync="Model.showDetial" top="100px">
				<!--  -->
				<div class="common-table-title">
					<div class="common-table-icon"></div>
					<div class="common-table-fl">款式信息详情</div>
				</div>
				<el-row class="common-table-con">

				</el-row>
			</el-dialog>
			<!-- 弹窗end -->
		</div>
	</div>
</template>

<script>
	import advancedSearch from "../../../../components/common/filter/advancedSearch"
	import Model from './model.js'
	import Controller from './controller.js'
	// import detialpage from './detial/index.vue'
	export default {
		name: 'styleInfo',
		mixins: [Model, Controller],
		components: {
			advancedSearch,
		},
		props: [
			''
		],
		created() {
			this.init()
		},
		mounted() {

		},
	}
</script>

<style scoped lang="less">
	@import "./index.less";
</style>
